//判断显示投票、关注、粉丝
var listType = getQueryString("listType");
if(listType == "voate_teacher"){
    API_URL+="agentclub/getvoteagent?openid="+openid;
    //隐藏上拉下拉加载条
    $('#pullDown').hide();
    $('#pullUp').hide();
}else if(listType == "focus_teacher"){
    API_URL+="agentclub/getagent?openid="+openid;
}else if(listType == "focus_me"){
    API_URL+="agentclub/getmyfans?openid="+openid;
}
//显示列表
function showList(obj) {
    $.get
    (
        API_URL,
        function (Obj) {
            var myData = Obj.basedata.data;
            var Str = "";
            for (var i = 0; i < myData.length; i++) {
                var agentItem = myData[i];
                //默认头像
                if (agentItem.icon == null || agentItem.icon == '') {
                    agentItem.icon = '../img/default.png';
            }
                //判断讲师
                var agent_category = '';
                if (agentItem.agent_category == 0) {
                    agent_category = "普通";
                } else if (agentItem.agent_category == 1) {
                    agent_category = "明星讲师";
                } else if (agentItem.agent_category == 2) {
                    agent_category = "品牌讲师";
                } else if (agentItem.agent_category == 3) {
                    agent_category = "总公司";
                }
                var agent_level = '';
                if(agentItem.agent_level == null || agentItem.agent_level ==''){
                    agent_level ='';
                }else {
                    if (agent_category == '') {
                        agent_level = agentItem.agent_level;
                    }else {
                        agent_level = '&' + agentItem.agent_level;
                    }
                }
                Str += '<a href="personal_page.html">' +
                            '<li class="teacher_items">' +
                            '<img src="' + agentItem.icon + '" alt=""/>' +
                            '<div class="infor_content">' +
                            '<h3>' + agentItem.name + '<i class="icon_guan"></i></h3>' +
                            '<p class="level">' + agent_category + agent_level + '</p>' +
                            '<p class="focused_num"><i class="icon_head"></i>' + agentItem.agent_fans_count + '</p>' +
                            '</div>' +
                            '</li>' +
                            '<input type="hidden" value="'+agentItem.createtime_time+'">'+
                        '</a>';
            }
            $('.star_list').html(Str);

        }
    )
}
$(function(){
    showList();
});